﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Display.aspx.cs" Inherits="Liguo.Store.Display" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>欢迎来到利果大百货</title>
    <link rel="stylesheet" href="../css/cart.css" />
    <link rel="stylesheet" href="../css/store.css" />
    <style>
        .pageset {
            position: absolute;
            top: 1050px;
            left: 300px;
        }

            .pageset a {
                text-decoration: none;
                height: 20px;
                padding: 3px 10px;
                border: 1px solid #ccc;
                margin-left: 2px;
                font-family: arial;
                line-height: 20px;
                font-size: 14px;
                overflow: hidden;
                -moz-border-radius: 5px;
                -webkit-border-radius: 5px;
            }

                .pageset a:hover {
                    background: #005aa0;
                    color: #fff;
                    text-decoration: none;
                }

        .a_jump {
            width: 30px;
            height: 20px;
            border: 1px solid #ccc;
            margin-left: 2px;
            font-family: arial;
            line-height: 20px;
            font-size: 14px;
            overflow: hidden;
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
        }

        .bar {
            position: absolute;
            top: 0px;
            width: 920px;
            height: 48px;
            background: #E4393C;
            text-align: center;
        }

            .bar strong {
                position: relative;
                top: 5px;
                color: #FFFFFF;
                font-size: 30px;
            }

        .item {
            width: 220px;
            height: 320px;
        }

        .title {
            height: 38px;
            font-size: 36px;
        }

        .goodsname {
            color: rgb(102, 102, 102);
            font-family: arial,宋体;
            font-size: 14px;
            font-size-adjust: none;
            font-stretch: normal;
            font-style: normal;
            font-variant: normal;
            font-weight: 400;
            line-height: 18px;
            list-style-image: none;
            list-style-position: outside;
            list-style-type: none;
            margin-bottom: 0px;
            margin-left: 0px;
            margin-right: 0px;
            margin-top: 0px;
            outline-color: rgb(0, 0, 0);
            outline-style: none;
            outline-width: 0px;
            padding-bottom: 0px;
            padding-left: 0px;
            padding-right: 0px;
            padding-top: 0px;
            text-align: center;
            text-decoration: none;
        }

            .goodsname:hover {
                text-decoration: underline;
            }

        .prices {
            color: rgb(228, 57, 60);
            font-family: verdana;
            font-size: 14px;
            font-size-adjust: none;
            font-stretch: normal;
            font-style: normal;
            font-variant: normal;
            font-weight: 700;
            line-height: 18px;
            list-style-image: none;
            list-style-position: outside;
            list-style-type: none;
            margin-bottom: 0px;
            margin-left: 0px;
            margin-right: 4px;
            margin-top: 0px;
            padding-bottom: 0px;
            padding-left: 0px;
            padding-right: 0px;
            padding-top: 0px;
            text-align: center;
            -moz-font-feature-settings: normal;
            -moz-font-language-override: normal;
        }

        .btncart {
            width: 180px;
            height: 40px;
            position: relative;
            left: 5px;
            top: 10px;
            font-size: 22px;
            font-family: SimHei;
            text-decoration: none;
            color: #FFFFFF;
            background: #E4393C;
            border: 10px solid;
            border-color: #E4393C;
            margin: 0;
            text-align: center;
        }

        .datalist {
            position: absolute;
            top: 80px;
            width: 800px;
            height: 40px;
        }

        .image {
            width: 210px;
            height: 210px;
        }

        .buttonlayout {
            text-align: center;
        }

        .space {
            height: 20px;
        }

        .bottom {
            width: 100%;
            height: 40px;
            position: absolute;
            top: 1300px;
        }
    </style>
    <script type="text/javascript">
        var goods = new Array(<%=goodsinfo%>);
    </script>
</head>
<body>
    <div style="height: 40px; width: 100%">
        <iframe src="Top.aspx"></iframe>
    </div>
    <div class="big_box">
        <div>
            <div class="logo">
                <a href="Store.aspx" target="_top">
                    <asp:Image ID="ImLogo" runat="server" ImageUrl="../res/Logo.png" />
                </a>
            </div>
            <div>
                <div class="search">
                    <form id="frmSearch" action="Display.aspx" method="post">
                        <input type="text" id="keyword" name="keyword" class="search_text" />
                        <input type="submit" id="btSearch" value="搜索" class="search_button" onclick="submitSearch();" />
                    </form>
                </div>
            </div>
        </div>
        <div class="big_block">
            <div class="navigation">
                <!--兼容IE早期版本的做法，不用在意-->
                <iframe src="Navigation.aspx#Menu=ChildMenu" frameborder="no" border="no"></iframe>
            </div>
            <div class="display">
                <form id="form1" runat="server">
                    <div>
                        <div class="bar">
                            <strong>利果大百货</strong>
                        </div>
                        <div class="datalist">
                            <asp:DataList ID="DataList1" runat="server" RepeatColumns="4" CellPadding="0" OnItemCommand="addInCartEvent">

                                <ItemTemplate>
                                    <div class="item">
                                        <table runat="server" style="width: 230px; height: 250px; border-right: black 0px solid; border-top: black 0px solid; border-left: black 0px solid; border-bottom: black 0px solid;">
                                            <tr>
                                                <td style="width: inherit; text-align: center">
                                                    <a href='Detail.aspx?ID=<%# Eval("ID") %>' target="_top">
                                                        <asp:Image ID="Image1" runat="server" ImageUrl='<%# "~/images/"+ Eval("PicturePath").ToString()+".png"%>'
                                                            CssClass="image" />
                                                    </a>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width: inherit; height: 12px; text-align: center">
                                                    <a href='Detail.aspx?ID=<%# Eval("ID") %>' class="goodsname">商品名称:
                                     <asp:Label ID="Label_GoodsName" runat="server" Text='<%# Eval("GoodsName") %>'></asp:Label>
                                                    </a>

                                                </td>

                                            </tr>
                                            <tr>
                                                <td class="prices">
                                                    <span>￥</span>
                                                    <asp:Label ID="Label_PerPrice" runat="server" Text='<%# Convert.ToDouble(Eval("Price")).ToString("F2") %>'></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td></td>
                                            </tr>
                                        </table>
                                        <div class="buttonlayout">
                                            <asp:LinkButton ID="Button_AddInCart" runat="server" CommandName="addoneitem" Text="加入购物车" CssClass="btncart" />
                                        </div>
                                    </div>
                                </ItemTemplate>
                            </asp:DataList>
                        </div>
                        <div class="pageset">
                            <asp:LinkButton ID="FirstLB" runat="server" OnCommand="LinkButton_Click"
                                CommandName="first">第一页</asp:LinkButton>&nbsp;
             <asp:LinkButton ID="PreviousLB" runat="server" OnCommand="LinkButton_Click" CommandName="prev">上一页</asp:LinkButton>&nbsp;
             <asp:LinkButton ID="NextLB" runat="server" OnCommand="LinkButton_Click" CommandName="next">下一页</asp:LinkButton>&nbsp;
             <asp:LinkButton ID="EndLB" runat="server" OnCommand="LinkButton_Click" CommandName="end">最末页</asp:LinkButton>&nbsp;&nbsp;
             总<asp:Label ID="TotalLbl" runat="server"></asp:Label>页 当前第<asp:Label ID="CurrentLbl" runat="server"></asp:Label>页
             <asp:LinkButton ID="JumpLB" runat="server" OnCommand="LinkButton_Click" CommandName="jump">跳到</asp:LinkButton>
                            <span>第</span><asp:TextBox ID="TextBox1" runat="server" CssClass="a_jump"></asp:TextBox>页
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="bottom">
        <!--兼容IE早期版本的做法，不用在意-->
        <iframe src="Bottom.aspx" frameborder="no" border="no"></iframe>
    </div>
    <div class="cart">
        <div class="cart_info">
            <img class="cart_icon" src="../res/cart.png" />
            <span class="cart_name">购物车</span>
            <span class="cart_rmb">￥</span>
            <script>
                document.write("<ul>");
                var count = goods.length;
                var price = 0.0;
                if (count > 0) {
                    for (i = 0; i < count; i++) {
                        price += goods[i].price;
                        document.write("<li><a href=\"Detail.aspx?ID=" + goods[i].id + "\" class=\"a_img\"><img class=\"goods_img\" src=\"../images/" + goods[i].img + ".png\" /></a>");
                        document.write("<span class=\"goods_num\">×" + goods[i].num + "</span>");
                        document.write("<a href=\"Detail.aspx?ID=" + goods[i].id + "\" class=\"goods_name\">" + goods[i].name + "</a>");
                        if (goods[i].method == 0 || goods[i].method == 2) {
                            document.write("<span class=\"goods_price\">￥" + goods[i].price.toFixed(2) + "</span></li>");
                        } else {
                            document.write("<span class=\"goods_price\">待定</span></li>");
                        }
                    }
                } else {
                    document.write("<li><span id=\"cart_none\">购物车为空</span></li>");
                }
                document.write("</ul>");
                document.write("<span class=\"cart_mon\">" + price.toFixed(2) + "</span>");
            </script>
        </div>
        <a class="cart_pay" href="Cart.aspx"><span>结算</span></a>
    </div>
</body>
</html>
